﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ModelLayer;

namespace WCFLayer
{
    
    [ServiceContract]
    public interface IFlightRouteService
    {
        #region Airport
        [OperationContract]
        int InsertAirport(Airport _airport);
        [OperationContract]
        Airport FindAirportByCode(string _airportCode);
        [OperationContract]
        Airport FindAirportByName(string _airportName);
        [OperationContract]
        int UpdateAirport(Airport _airport);
        [OperationContract]
        List<Airport> SelectAllAirports();
        [OperationContract]
        int RemoveAirport(Airport _airport);
        #endregion
        #region Dijkstra
        [OperationContract]
        List<FlightInstance> GetCheapestRoute(Airport _startAirport, Airport _endAirport, DateTime _flyDate);
        [OperationContract]
        List<FlightInstance> GetQuickestRoute(Airport _startAirport, Airport _endAirport, DateTime _flyDate);
        #endregion Dijkstra
        #region Flight

        [OperationContract]
        int InsertFlight(Flight _flight);
        [OperationContract]
        List<Flight> FindFlightByAirport(string _airportCode);
        [OperationContract]
        Flight FindFlightByID(int _routeId);
        [OperationContract]
        int UpdateFlight(Flight _flight);
        [OperationContract]
        List<Flight> SelectAllFlights();
        [OperationContract]
        int RemoveFlight(Flight _flight);

        #endregion
        #region FlightInstance

        [OperationContract]
        int InsertFlightInstance(FlightInstance _flightInstance);
        [OperationContract]
        List<FlightInstance> FindFlightInstaceByFlight(Flight _flight);
        [OperationContract]
        FlightInstance FindFlightInstanceById(int _id);
        [OperationContract]
        List<FlightInstance> FindFlightInstancesByFlightAndDate(Flight _flight, DateTime _date);
        [OperationContract]
        List<FlightInstance> SelectAllFlightinstances();
        [OperationContract]
        int RemoveFlightInstance(FlightInstance _flightInstance);
        [OperationContract]
        int UpdateFlightInstace(FlightInstance _flightInstance);
        #endregion
        #region SeatBooking
        [OperationContract]
        int InsertSeatBooking(SeatBooking _seatBooking, int _travelID);
        [OperationContract]
        int RemoveSeatBooking(SeatBooking _seatBooking);
        [OperationContract]
        SeatBooking FindSeatBookingByFlightAndSeat(FlightInstance _flightinstance, Seat _seat);
        [OperationContract]
        int UpdateSeatBooking(SeatBooking _seatBooking);
        [OperationContract]
        List<SeatBooking> SelectAllSeatBookings();
        

        #endregion
        #region Travel

        [OperationContract]
        int InsertTravel(Travel _travel);
        [OperationContract]
        Travel FindTravel(int _travelId);
        [OperationContract]
        int UpdateTravel(Travel _travel);
        [OperationContract]
        List<Travel> SelectAllTravels();
        [OperationContract]
        int RemoveTravel(Travel _travel);

        #endregion
        #region Person

        [OperationContract]
        int InsertCustomer(Customer _customer);
        [OperationContract]
        Customer FindCustomerByPhoneNumber(int _phoneNo);
        [OperationContract]
        List<Customer> SelectAll();
        [OperationContract]
        int UpdateCustomer(Customer _customer);
        [OperationContract]
        int RemoveCustomer(Customer _customer);
       
        #endregion
        #region Plane

        [OperationContract]
        int InsertPlane(Plane _plane);
        [OperationContract]
        Plane FindPlaneByPlaneNo(string _planeNo);
        [OperationContract]
        List<Plane> SelectAllPlanes();
        [OperationContract]
        int UpdatePlane(Plane _plane);
        [OperationContract]
        int RemovePlane(Plane _plane);

        #endregion
        #region Seat

        [OperationContract]
        int InsertSeat(Seat _seat);
        [OperationContract]
        int RemoveSeat(Seat _seat);

        [OperationContract]
        Seat FindSeatBySeatNoAndPlaneNo(string _seatNo, string _planeNo);
        [OperationContract]
        List<Seat> SelectAllSeats();
        [OperationContract]
        List<Seat> SelectFreeSeats(FlightInstance _flightInstance);
        #endregion
    }
}
